package org.strongme.modules.project.entity;

import java.util.List;

import org.strongme.common.persistence.DataEntity;
import org.strongme.util.StringUtils;

import com.google.common.collect.Lists;

/**
 * 工程
 * @author Walter
 *
 */
public class Project extends DataEntity<Project>{

	private static final long serialVersionUID = -8187499496894885046L;
	private String suoxie;
	/**
	 * 工程名称
	 */
	private String name;
	/**
	 * 委托单位
	 */
	private String client;
	/**
	 * 承压设备类别
	 */
	private String cysblb;
	/**
	 * 监理单位
	 */
	private String jldw;
	/**
	 * 施工单位
	 */
	private String sgdw;
	/**
	 * 负责人
	 */
	private String fzr;
	/**
	 * 检测项目
	 */
	private String jcxm;
	
	private List<String> jcxmList = Lists.newArrayList();
	
	private List<SubProject> subProjectList = Lists.newArrayList();
	
	public Project() {
		super();
	}
	
	public Project(String id) {
		super(id);
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getClient() {
		return client;
	}
	public void setClient(String client) {
		this.client = client;
	}
	public String getCysblb() {
		return cysblb;
	}
	public void setCysblb(String cysblb) {
		this.cysblb = cysblb;
	}
	public String getJldw() {
		return jldw;
	}
	public void setJldw(String jldw) {
		this.jldw = jldw;
	}
	public String getSgdw() {
		return sgdw;
	}
	public void setSgdw(String sgdw) {
		this.sgdw = sgdw;
	}
	public String getFzr() {
		return fzr;
	}
	public void setFzr(String fzr) {
		this.fzr = fzr;
	}
	public String getJcxm() {
		return jcxm;
	}
	public void setJcxm(String jcxm) {
		this.jcxm = jcxm;
		if(jcxm!=null) {
			this.jcxmList = Lists.newArrayList(this.jcxm.split(","));
		}
	}

	public List<SubProject> getSubProjectList() {
		return subProjectList;
	}

	public void setSubProjectList(List<SubProject> subProjectList) {
		this.subProjectList = subProjectList;
	}

	public String getSuoxie() {
		return suoxie;
	}

	public void setSuoxie(String suoxie) {
		this.suoxie = suoxie;
	}

	public List<String> getJcxmList() {
		List<String> result = Lists.newArrayList();
		if(jcxm!=null) result = Lists.newArrayList(jcxm.split(","));
		return result;
	}

	public void setJcxmList(List<String> jcxmList) {
		this.jcxmList = jcxmList;
		this.jcxm = StringUtils.join(jcxmList, ",");
	}

	
}
